package cn.tedu.lbs.basic.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.pojo.basic.po.AreaPO;
import com.tarena.lbs.pojo.basic.po.UserGroupPO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserGroupMapper extends BaseMapper<UserGroupPO> {
    @Select("SELECT distinct ug.id\n" +
            "FROM lbs_user_tags ut\n" +
            "         JOIN lbs_user_group ug ON FIND_IN_SET(ut.tag_id, ug.tag_ids)\n" +
            "WHERE ut.user_id = #{userId} and ug.business_id=#{businessId};")
    List<Integer> getUserGroupIds(@Param("userId")Integer userId, @Param("businessId")Integer businessId);
}
